The right attitude is about 95% of being successful as an accompanist. If you don't like to accompany, you will probably not be a successful sideman who is sought after. Mainly, just stay out of the way but try to reinforce, punctuate in between the soloist's ideas and make him (or her) feel comfortable! If you are working with a guitar player, you both should play a lot less then you would if the other was not there or you can simply take turns. You might comp for one solo and then lay out and let the guitarist comp for the next. The guitarist can lay out sometimes too thus creating a nice change of texture.
A good reality check is to ask yourself at various times, "Can I sing back what the soloist just played?" If you can't, it may mean that you are not listening close enough. I'll always remember that Clark Terry used to stand at the end of the keyboard and I would hear him singing licks I played right after I played them. He wasn't an accompanist but I was impressed that he was "in the flow" of the music at all times and aware of everything that was going on. Another thing that C. T. used to do (and most great leaders will) was to play certain ideas now and then that really demanded that the rhythm section catch obvious accents with him. It was his way of seeing if we were paying attention!
Remember, you will be expected to be a strong soloist but that's not why people will ask you to play. If you complement them and make them feel good on the bandstand, they will always ask you to play! The operative word here is "Listening". Of course, you have to listen for a number of things like what kind of sound you hear, or where to punctuate (or complete) the soloist's idea. Do what comes naturally but listen to pianists whose comping you think is good and see how they react to a soloist. Remember, sometimes you don't react; you just try to create a feel, maybe with a repetitive figure and let the soloist float over the top of that. There's too many approaches to begin to list them all but one idea might be to try to be part of the solo, don't just play along with it!