|MadSci Network: Evolution|
The mosquito "bites" animals in order to get blood. When it injects its proboscis into our blood vessel, it also releases its saliva. The saliva contains, among other things, an anti-clotting agent which prevents the blood from clotting in its mouth and gut. Also in the saliva is a toxin which, as you stated, causes histamine to bind to animal cells, resulting in the oft-cursed "mosquito bite".
So, in answer to your question, the release of saliva is necessary for its function. The itching/hurting is just an incidental side effect.
I hope this answers your question. If you have any further questions, please feel free to E-mail me at firstname.lastname@example.org.
Try the links in the MadSci Library for more information on Evolution.