Charge renormalization of the Yang-Mills theory up to fourth order using dimensional regularization