We present a finite-difference integration algorithm for solution of a system of differential equations containing a diffusion equation with nonlinear terms. The approach is based on Crank-Nicolson method with predictor-corrector algorithm and provides high stability and precision. Using a specific example of short-pulse laser interaction with semiconductors, we give a detailed description of the method and apply it for the solution of the corresponding system of differential equations, one of which is a nonlinear diffusion equation. The calculated dynamics of the energy density and the number density of photoexcited free carriers upon the absorption of laser energy are presented for the irradiated thin silicon film. The energy conservation within 0.2% has been achieved for the time step $10^4$ times larger than that in case of the explicit scheme, for the chosen numerical setup. We also present a few examples of successful application of the method demonstrating its benefits for the theoretical studies of laser-matter interaction problems.