Wallays, riding for Lotto Soudal, held off Norwegian Sven Erik Bystrom, with Slovakia's world champion Peter Sagan coming third in a strong finish by the chasing peloton.
Mitchelton-Scott rider Yates remained 25 seconds ahead of his nearest rival, Spanish veteran Alejandro Valverde, in the general classification.
Another Spaniard, Enric Mas of Quick Step, stayed in third 1min 22sec behind the red jersey.
Friday's 19th stage is a 154.4km ride from Lerida to the Naturlandia nature park in Andorra.