Optimal Contracts, Capital Structure, and Infrastructure Project Financing