The VSC and ABS lights have been on, and the code said right rear wheel sensor. Replaced it, no difference, so investigated further today.
Had the car up on the lift, removed the rear sensors, lots of swarf, peered into the holes, found the problem - something had worn down the ABS rings.
Removed a driveshaft nut and tapped the shaft back so that we could see the ring, and could see that something (dust seal?) had been rubbing against it. The other side is also worn own, so need two driveshafts. So far so good.
Put it back together. Drove home, and the speedo was behaving oddly, not reading below about 20, and now it's stopped working altogether, although the cruise control is working perfectly.
Any ideas? I thought the speedometer took its signal from the gearbox. How could we have affected it by messing about with the driveshaft/rear ABS sensors? Just coincidence?