War in Iraq and terrorism shape the presidential campaign