Temporal and spectral variations of the photoelectron flux and solar irradiance during an X class solar flare