Mariano Rajoy's People's Party has won the most seats in the Spanish parliamentary election but is still short of a majority.