The Impact of Religion on the Evolution of Cooperation and Conflicts