Wilson-'t Hooft operators in four-dimensional gauge theories and S-duality