Spanish King Juan Carlos has abdicated in favour of his son Crown Prince Felipe, prime minister Mariano Rajoy announced.