Optically induced currents in dielectrics and semiconductors as a nonlinear optical effect