Dynamic coupled-mode theory of nonlinear propagation in optical fibers