Improving the Weizsäcker-Williams approximation in electron-proton collisions