For a trip to Barcelona, Madrid, Valencia and Ibiza, I see no value in a car whatsoever. There are very fast trains between those three cities. I wouldn't be interested in driving from Barcelona to Madrid (estimated at 6 hr. 31 min. driving time on ViaMichelin.com) when the train could get me there in as little as 2 hr. 30 min. In addition, you can pack a lunch and eat it on the train. The most often mentioned side trips from Barcelona and Madrid are also easy by public transportation.
You didn't say what time of year you plan to take the trip, but your mention of "beaches" suggests you may be thinking of summer. Although I really like Andalucia (Seville, Cordoba and Granada), I wouldn't go there in the summer. At that time of year it's possible to have a week of 100+F days. Even Madrid can be very hot in the summer, and Barcelona can be humid. In any case, even if you left out Ibiza (big-time party island--is that what you're looking for?), Barcelona, Madrid, Valencia, Seville, Cordoba and Granada would be an awful lot of ground to cover in 14-16 days.