Photon distribution in the dynamical Casimir effect with an account of dissipation