A Model Predictive Control Strategy for Lateral and Longitudinal Dynamics in Autonomous Driving