Joint Optimization of Maintenance and Production Policies