Measurement of the W boson production charge asymmetry in proton-antiproton collisions