The existence of optimal contracts in the principal-agent model