Optical generation rate of electron-hole pairs in multilayer thin-film photovoltaic cells