The European Union has agreed to offer protection for refugees from Ukraine.