S-duality and the dyon spectrum in N = 2 super Yang-Mills theory