Polar potassium rare earth nitrates K2[RE(NO3)5(H2O)2] (RE = La, Ce, Pr and Nd). II. Linear and nonlinear optical properties