A stochastic model for nondemolition continuous measurement in a quantum system is given. It is shown that the posterior dynamics, including a continuous collapse of the wave function, is described by a nonlinear stochastic wave equation. For a particle in an electromagnetic field it reduces the Schroedinger equation with extra imaginary stochastic potentials.