Safety bars must be secure after installation and you must think long term. Some bars actually come with plastic drywall mounts, you know, the ones where you drill out a small hole, push in the plastic, and then screw to it. If you bought a kit with such directions, disregard them.
First, figure out the height above the tub where you want the bar. With a standard tub I use somewhere around 28″ above the floor. Check your building local codes.
Above, I placed blocking horizontally across the entire length of the back wall (behind the red tape) to screw to.
The vertical bar will screw into the wall stud (see below).
Here you can see both horizontal and vertical bars installed permanently. If you do not use blocking, these bars will surely loosen and you will have to remodel again. This little tip will save you a lot of time and money in the long run.
Lots more tiling tips here.