On the Problem of Electromagnetic-Field Quantization