We compute the cosmic star formation rate (SFR) and the rest-frame comoving luminosity density in various passbands as a function of redshift using large-scale ΛCDM hydrodynamical simulations, with the aim of understanding their behavior as a function of redshift. To calculate the luminosity density of galaxies, we use an updated isochrone synthesis model that takes metallicity variations into account. The computed SFR and the UV luminosity density have a steep rise from z = 0 to 1, a moderate plateau between z = 1-3, and a gradual decrease beyond z = 3. The raw calculated results are significantly above the observed luminosity density, which can be explained either by dust extinction or the possibly inappropriate input parameters of the simulation. We model the dust extinction by introducing a parameter f, the fraction of the total stellar luminosity (not galaxy population) that is heavily obscured and thus only appears in the far-infrared to submillimeter wavelength range. When we correct our input parameters (baryon mass-density and the yield of metals) to the current best estimate and apply dust extinction with f = 0.65, the resulting luminosity density fits various observations reasonably well, including the present stellar mass density, the local B-band galaxy luminosity density, and the FIR-to-submillimeter extragalactic background. Our result is consistent with the picture that ~2/3 of the total stellar emission is heavily obscured by dust and observed only in the FIR. The rest of the emission is only moderately obscured, which can be observed in the optical to near-IR wavelength range. We also argue that the steep falloff of the SFR from z = 1 to 0 is partly due to the shock-heating of the universe at late times, which produces gas that is too hot to easily condense into star-forming regions.