The IRX-β relation on subgalactic scales in star-forming galaxies of the Herschel Reference Survey