Impact of a magnetic field on the thermodynamics of magnetized quark matter