EU countries agree on compromise for overhaul of bloc's fiscal rules