Computing optical absorption spectra from first principles: Self-energy and electron-hole interaction effects