Sudanese President Omar al-Bashir has declared a four-month ceasefire in two states of Blue Nile and South Kordofan, where recent fighting between troops and rebels has left scores of casualties, the army has said.