Baryogenesis from spontaneous CP violation in the early Universe