US Defence Secretary Robert Gates has warned of "dramatic consequences" if Washington and Baghdad do not agree a security deal on US forces in Iraq.