Evolution of cooperation in stochastic games