Separation of scattering and absorption contributions in UV/visible spectra of resonant systems