European countries announce agreement to curb illegal immigration