Quantum effects in nonlinear optics and polaritonics