By modeling a linear polarizable and magnetizable medium (magnetodielectric) with two quantum fields, namely E and M, electromagnetic field is quantized in such a medium consistently and systematically. A Hamiltonian is proposed from which, using the Heisenberg equations, Maxwell and constitutive equations of the medium are obtained. For a homogeneous medium, the equation of motion of the quantum vector potential, A, is derived and solved analytically. Two coupling functions which describe the electromagnetic properties of the medium are introduced. Four examples are considered showing the features and the applicability of the model to both absorptive and nonabsorptive magneto-dielectrics.