An Equilibrium Analysis of Optimal Audit Contracts