The energy levels of the left- and the right-handed neutrinos are split in the background of gravitational waves generated during inflation, which, in presence of lepton-number-violating interactions, gives rise to a net lepton asymmetry at equilibrium. Lepton number violation is achieved by the same dimension five operator which gives rise to neutrino masses after electroweak symmetry breaking. A net baryon asymmetry of the same magnitude can be generated from this lepton asymmetry by electroweak sphaleron processes.