Conditional Cooperation and Voluntary Contributions to Public Goods