Contracting for Artificial Intelligence