Quantum lifetime of two-dimensional electrons in a magnetic field