Gravitational corrections in supersymmetric gauge theory and matrix models