Monte Carlo studies of nonequilibrium phonon effects in polar semiconductors and quantum wells. I. Laser photoexcitation