The cleric 's bloc worked out a deal to be part of the new Iraqi government , and its support helped Prime Minister Nouri al-Maliki secure a second term .