Iraq has held its parliamentary elections, amid threats and violence aimed at keeping voters from the polls.