How can I repair a towel rack that was ripped out of the wall?
Since you already have a wall paper finish on the wall and you are hesitant to move the towel bar to another location this does put a damper on the types of solutions that could be used to fix this problem. By the way; Don't feel too bad about the failure. It is very common to find towel bars attached just into the drywall. :-(

The normal "robust" way to fix this would be to make a hole in the drywall near where the mount ripped out of the wall. Such hole would be about 2" (5omm) high by 4" (100mm) wide. A piece of wood with string around its middle would be placed down into the slot and then raised back up inside the wall using the string to pull it back up so that it was centered over the opening. A 3.5" (85mm) wide by 8-12" (200-300mm) long board would be used for this. Holding the board in place with the string, you would install drywall screws through the exiting wall board and into the wood to hold it in place. Patch up would consist of cutting a small piece of new drywall to fill in the slot hole and screwing it in place. Drywall taping, mud and sanding would be done to finish the wall back to a nice finish so that it could be re-painted. With this scheme the towel bar support can now be re-installed using longer screws to reach into the wood support that was added. The wood support spreads the stress of the towel bar across a much greater area of the wall preventing future tear out.

Now that you have a picture of what could be done let me suggest an alternate approach that will provide a strong support and permanent fix. For this you would remove both towel bar brackets and install a primed and pre-painted horizontal board across the wall in line where the towel bar mounted. You would secure this in place using screws into the nearby studs. If the towel bar was mounted in a narrower wall segment it is best, from a looks standpoint, to extend the board across the width of the wall. After the board is mounted in place the screw holes would be filled with spackle, sanded and touch up painted. The towel bar is then mounted onto this painted board. 

With this latter approach it may be desirable to size up the room and if there are other towel bars present you may want to install these board strips in a uniform manner for those as well to maintain a style in the room. 

If you saved some of the original wall paper it is also possible to glue wall paper onto these strips after they have been primed. Done carefully the wall paper pattern can be matched to the wall and make the towel bar mounting boards hardly noticeable.