Combining QED and QCD transverse-momentum resummation for Z boson production at hadron colliders