Optimal contract for experimentation and production