Dilepton production from AGS to SPS energies within a relativistic transport approach