Multi-instanton calculus in N=2 supersymmetric gauge theory. II. Coupling to matter.