Hi I see two potential options:
Option 1 (the fast route): Simply drop off your car in San Sebastian, and take an early morning direct flight (1 hr) to Barcelona on vueling, Iberia etc. tickets go for around €50, there are multiple flights. This option will save you the most money and time for Barcelona.
Option 2 (the scenic route): This would be my personal recommendation, the area between San Sebastian and Barcelona (Aragon and Navarra) is an ancient land of Roman ruins, Moorish palaces, and Medieval castles, and the best part will feel like you have all to yourselves to explore, compared to the throngs of tourists you will find in San Sebastian and Barcelona. If you do not foresee coming back to this corner of Spain I think you would miss out.
First, I would use the rental car to drive south-east to the Royal Medieval Palace of Olite (one of my favourite castles in Spain), then I would continue east until you reach Zaragoza (capital of Aragon). Once in Zaragoza, drop off your car and visit some of her impressive sights, la Aljaferia Moorish Palace, Basilica de Nuestra Señora de Pilar, and maybe some of the Roman ruins like the Forum or Theatre, the Mudejar Architecture of Zaragoza has been named a UNESCO WHS. After have lunch in El Tubo tapas district. Then catch the AVE high speed train, from Zaragoza Delicias station, direct to Barcelona (1:30 hr). While this will certainly take up the entire day, I think it will be well worth it and very rewarding in the end.