Characterization of exoplanets from their formation III: The statistics of planetary luminosities