We analyze the effects of an applied magnetic field on the phase diagram of a weakly correlated electron system with imperfect nesting. The Hamiltonian under study describes two bands: electron and hole ones. Both bands have spherical Fermi surfaces, whose radii are slightly mismatched due to doping. These types of models are often used in the analysis of magnetic states in chromium and its alloys, superconducting iron pnictides, AA-type bilayer graphene, borides, etc. At zero magnetic field, the uniform ground state of the system turns out to be unstable against electronic phase separation. The applied magnetic field affects the phase diagram in several ways. In particular, the Zeeman term stabilizes new antiferromagnetic phases. It also significantly shifts the boundaries of inhomogeneous (phase-separated) states. At sufficiently high fields, the Landau quantization gives rise to oscillations of the order parameters and of the Néel temperature as a function of the magnetic field.