Costly Monitoring, Loan Contracts, and Equilibrium Credit Rationing