A Trust Region Algorithm for Nonlinearly Constrained Optimization