Electron decoherence in a semiconductor due to electron-phonon scattering