The quadratic response function has been derived and implemented at the adiabatic four-component Kohn-Sham density functional theory level with inclusion of noncollinear spin magnetization and gradient corrections in the exchange-correlation functional-a work that is an extension of our previous report where magnetization dependencies in the exchange-correlation functional were ignored [J. Henriksson, T. Saue, and P. Norman, J. Chem. Phys. 128, 024105 (2008)]. The electric-field induced second-harmonic generation experiments on CF3Cl and CF3Br are addressed by a determination of (beta) over bar (-2 omega;omega,omega) for a wavelength of 694.3 nm, and the same property is also determined for CF3I. The relativistic effects on the static hyperpolarizability for the series of molecules amount to 1%, 5%, and 9%, respectively. At the experimental wavelength, the contributions to beta due to the magnetization dependence in the exchange-correlation functional are negligible for CF3Cl and CF3Br and small for CF3I. The noticeable effect of magnetization in the latter case is attributed to a near two-photon resonance with the excited state 1 E-3 (nonrelativistic notation). It is emphasized, however, that the effect of magnetization on beta for CF3I is negligible both in comparison to the total relativistic correction as well as to the effects of electron correlation. It is concluded that, in calculations of hyperpolarizabilities under nonresonant conditions, the magnetization dependence in the exchange-correlation functional may be ignored. (C) 2009 American Institute of Physics. [DOI: 10.1063/1.3054302]