My best idea: hard to describe without a diagram, therefore, I'll make successive approximations from a basic easy to understand idea:
Get two 2x4's, equal in length to the height of the rack. Mount them vertically as standouts for the two vertical poles on the towel rack.
Modification 1: instead of the full length, maybe 4 inches on the top and bottom on both sides
Modification 2: wood that matches the room
Modification 3: instead of a 2x4 for the dimension, get something that would have to be ripped in half. Say, approximately, a 2x8 4 inches long. Rather than cut it into two 2x4 pieces, 4 inches long, use a drill bit with the same diameter as the towel rack to cut it in half. (or at least bore all the way through, then carefully cut it in half down the center of the hole) That way, the towel rack's roundness will match up to the edge of the wood 4 inches (3 1/2 or whatever) from the wall.
There are a variety of ways to mount it to the wall, and to mount the towel rack to the wood.