BRUSSELS—Serbia and Kosovo, which fought a war in the late 1990s, took another step toward reconciliation Tuesday with a deal that, among other things, will allow Kosovars to have their own country code.

The agreement, brokered by European Union foreign policy chief Federica Mogherini, also grants more rights to Serb communities living in the north of Kosovo, a former province of Serbia.

Kosovo,...