Formation of singularities in solutions of the nonlinear Schrödinger equation