Hi glad I could help you out already with a little trip inspiration :-)
I'd say 2 nights is good enough to see Teruel, it's not too big of a town and it's historic area is even smaller. You could add an extra night if you wanted to use it as a base to daytrip from. The village of Albarracín makes for a good day trip, it's very beautiful but one needs a car to reach it.
I probably wouldn't go so far north to Tarragona, instead I'd suggest maybe a night or two in Peñíscola. With its cobbled streets and whitewashed houses, the old town of Peñíscola sits on a big rock that juts out into the sea. The town is dominated by a large Knights Templar castle that looks like something out of the Levant, very atmospheric. There is a very good seafood restaurant under the bastions of the olde Templar Castle called El Peñón.
Other places along your general route I'd suggest are:
Sagunto (Saguntum) - settlement sacked by Hannibal Barca that led to the Second Punic War. Now an eclectic mix of Roman, Moorish, and Christian fortifications. Just north of Valencia.
Roman town of Segobriga - an almost intact Roman town that was completely abandoned during the very early middle ages, only recently begun excavations, relatively undiscovered by most foreign and even local tourists. Halfway between Madrid and Cuenca.
La Ciudad Encantada - just north of Cuenca, makes for a great little day trip. La Ciudad Encantada is a protected geological site with many large and unusual rock formations created through the erosion of the Júcar river, which makes it look like an "Enchanted City", which is it's namesake in Spanish. Many films were shot here, including Conan the Barbarian with Arnold Schwarzenegger. Perfect for light hiking.
Reccopolis Archeological Park - haven't been here myself but it's high on my list. It's the ruins of a Visigothic city of Reccopolis, the only city to be founded in Western Europe for several hundred years after the fall of the Roman Empire. Also halfway between Madrid and Cuenca.
As you can see there is a lot of deep history in this area, we even have a name for it in Spain we call "España Profunda" means deep Spain in both the figurative and literal sense. I think this area is hardly known to foreigners, all to your advantage I think :)