The dollar rose as conflict in the Middle East sent oil prices higher and encouraged investors to seek safe-haven assets.