As an Iranian I can tell you that breast-feeding in public is NOT a crime (at least in Iran) and you don't need to expect any severe consequences for this ;) Mothers do feed their children here whenever/wherever needed and it's none of anybody's business to question them why they are feeding their children. It's however usually a good practice for breasts to be revealed the least possible while feeding the baby (maybe covered under the scarf). You are a foreigner and would be of more attraction to people here as foreigners usually are.
Have a nice trip :)
Update:
I asked a lawyer about this to double-check. There is nothing mentioned in law to prohibit breast-feeding in public. Which means this act is not a crime unless interpreted contrary to Islamic rules. According to Islamic rules on the other hand, every action is permitted in case of emergency e.g. one is allowed to steal something to eat if dying from hunger. Therefore it's concluded that breast-feeding is always permitted because if the baby is not fed s/he will god-forbid die! And this is considered an absolute case of emergency :)