U.N. official says Secretary-General Kofi Annan has written a letter to Iran 's new president , Mahmoud Ahmadinejad , demanding the release of a jailed dissident journalist .