Effect of the magnetic field on the energy spectra of a quantum dot system