A scalar and vector potential formulation for finite element solutions to Maxwell's equations