Two-dimensional (2D) materials are a new type of materials under intense study because of their interesting physical properties and wide range of potential applications from nanoelectronics to sensing and photonics. Monolayers of semiconducting transition metal dichalcogenides MoS2 or WSe2 have been proposed as promising channel materials for field-effect transistors (FETs). Their high mechanical flexibility, stability and quality coupled with potentially inexpensive production methods offer potential advantages compared to organic and crystalline bulk semiconductors. Due to quantum mechanical confinement, the band gap in monolayer MoS2 is direct in nature, leading to a strong interaction with light that can be exploited for building phototransistors and ultrasensitive photodetectors. Here, we report on the realization of light-emitting diodes based on vertical heterojunctions composed of n-type monolayer MoS2 and p-type silicon. Careful interface engineering allows us to realize diodes showing rectification and light emission from the entire surface of the heterojunction. Electroluminescence spectra show clear signs of direct excitons related to the optical transitions between the conduction and valence bands. Our pn diodes can also operate as solar cells, with typical external quantum efficiency exceeding 4%. Our work opens up the way to more sophisticated optoelectronic devices such as lasers and heterostructure solar cells based on hybrids of two-dimensional (2D) semiconductors and silicon.