Autonomous and connected vehicles are becoming the next piece of the 5G connectivity puzzle. Dealing with a diversified set of use cases, ranging from manoeuvrer negotiation to infotainment, autonomous and connected vehicles call for a radically new approach to mobile networking. Multi-access Edge Computing (MEC) and network slicing have emerged to address such a challenge. The former, MEC, allows offloading computationally intensive tasks to nodes located very close to the vehicles. Slicing, in turn, allows instantiating multiple virtual networks, each of them tailored to meet the requirements of a specific service class, e.g. low latency, on top of the same infrastructure. In this paper, we introduce a novel design for a 5G network for autonomous and connected vehicles combining MEC and network slicing. The resulting solution allows features like lane tracking and object detection to be safely offloaded to the 5G network without impairing their effectiveness.