It could also be that your saddle is angled back just a bit. That would be the first thing I would check. An 18" mtb should not be to small for you if you are 6'. An 18" frame will work for someone up to 6'2" easily.
What bike do you have(manufacturer/modle)? There are 18" frames with short toptubes (for a mtb) and that could be the problem but I do not think you would have one but you may.
You could ask your question the mountain bike section since a lot of the posters there do not look here and you may get more advice.