The first thing you should do if harassed in Istanbul (or anywhere) is get to a safe location or get rid of the harassers. This can be as simple as walking into a safe looking restaurant or cafe, turning around on the harassers and saying in a very loud and calm voice "Yapma" which means "don't do that", asking bystanders for help "Bana yardım edin", or in a worst case scenario, scream. Because Turkey has a very strong culture of shame (as opposed to guilt) getting bystanders on your side and embarassing the harasser is very easy and effective.
The next step should be to access Istanbul-en.ihollaback.com, which has contact information for women's organizations and advise on making contact with police or lawyers (should you want them). More importantly, the site offers an opportunity to share your story and make contact with others, providing a grass-roots method of empowerment.
Also, please read: http://istanbul-en.ihollaback.org/