Dependence of the NMR relaxation time on the magnetic field in quasi-one-dimensional and quasi-two-dimensional crystals