Mariano Rajoy will serve a second term as leader, with his conservative People's Party securing enough support in the parliament.