Vegetarianism is becoming increasingly popular in Iran. Tell people you are "giyah-khor" or simply "vezheterian". This article lists 10 vegetarian restaurants in Tehran:
It is in Persian, but you can print it out and take it with you to Iran and ask someone there to read it for you.
Ananda has a site in English: http://anandaveg.com/?lang=en
Some vege restaurants have their own sites:
Giahitarin (in Persian): http://giahitarin.com/restaurants/رستور ... -در-تهران/
Zamin (vegan, in Persian): http://www.zaminvegan.ir
House of Artists (worth visiting also for its exhibitions and garden): iaveg.com/fa/
Darakht-e Banyan (in Persian): http://www.banyantreeveg.com
As for fast-food, apart from pizza (ask for sabzijot) there are many places that offer felafel sandwiches. There are soup stands as well and some of the popular soups are vegetarian. Ash-e reshteh is the most famous, and is filling and delicious.
When in Esfahan have it in the courtyard of the Abbasi hotel on Thursday evenings where it is a specialty -- but don't arrive too late as they may run out.
In Tehran there is an excellent soup seller (take-out only) near the entrance to the Tajirish bazaar facing the Emamzadeh Saleh, as well as a sit-down place on the north side of the square not far away near the pedestrian overpass.
If you are invited to dinner at an Iranian home they will likely offer you one or more kinds of stew, dishes that are either not available in restaurants or not very good because they are difficult and time-consuming to make. These include fesanjan (walnut and pomegranate), badamjan (eggplant), gheymeh (lentils), and ghormeh sabzi (chopped greens with kidney beans).
All are delicious without meat; simply ask your host to set aside a portion for you during preparation before adding the meat.