Equation of state of a dense and magnetized fermion system