We detail the influence of a magnetic field on exciton-polaritons inside a semiconductor microcavity. Magnetic field can be used as a tuning parameter for exciton and photon resonances. We discuss the change of the exciton energy, the oscillator strength, and redistribution of the polariton density along the dispersion curves due to the magnetically induced detuning. We have observed that field-induced shrinkage of the exciton wave function has a direct influence not only on the exciton oscillator strength, which is observed to increase with the magnetic field, but also on the polariton linewidth. We discuss the effect of the Zeeman splitting on polaritons the magnitude of which changes with the exciton Hopfield coefficient and can be modeled by independent coupling of the two spin components of excitons with cavity photons.