Dielectron measurements in pp and Pb-Pb colllisions with ALICE at the LHC