We study the spin Hall effect of a two-dimensional electron gas in the presence of a magnetic field and both the Rashba and Dresselhaus spin-orbit interactions. We show that the value of the spin Hall conductivity, which is finite only if the Zeeman spin splitting is taken into account, may be tuned by varying the ratio of the in-plane and out-of-plane components of the applied magnetic field. We identify the origin of this behavior with the different role played by the interplay of spin-orbit and Zeeman couplings for in-plane and out-of-plane magnetic field components.