Republican presidential candidates including Mitt Romney and Jon M. Huntsman Jr are demanding a swift withdrawal from Afghanistan, while Democrats complain that the cost of the war is siphoning money away from efforts to create jobs in the United States.