A gamma-ray determination of the Universe's star formation history