I apologize for taking forever to respond to this question.
Andrei said:
I thought about the following structure: $G=(U,\,\mathbb{N}\cup\{0\}\mid R)$, where $U$ is the set of vertices, and $R(a,n)$ means that vertice $a$ has $n$ adjacent edges.
Knowing the degree of each vertex does not uniquely determine the graph even for simple graphs. Imagine two disjoint triangles, on the one hand, and a hexagon, on the other hand. These two graphs have the same number of vertices and each vertex has degree 2, but they are not isomorphic.
As
Wikipedia describes, there are two flavors of multigraphs. In the first one, we can only say how many edges there are between two given vertices, but we cannot distinguish or identify individual edges. In the second flavor, we can refer to individual edges. The problem probably talks about the first kind. In this case, you can describe a multigraph if instead of a relation $R(a,n)$ between vertices and numbers you have a function $f:V\times V\to\mathbb{N}$ where V is the set of vertices. Then $f(a,b)$ says how many edges there are between $a$ and $b$.
Andrei said:
This looks suspicious: I learned that a structure has a single underlying set.
You are right: a structure as defined in the book has a single underlying set, or, domain. However, first, it is easy to generalize first-order logic into
many-sorted logic, where structures have several domains and each function or predicate symbol in the vocabulary is assigned not only the number of arguments, but also types of those arguments, which signify from which domain a given argument comes. This extension of first-order logic is routine and does not raise any significant problems.
Alternatively, we can consider an underlying set $U$ to be a
disjoint union of two or more sets, in this case, the set of vertices and the set of natural numbers. Of course, the function $f$ that assigns the number of edges to a pair of vertices, like any function in a structure, must be total on $U\times U$. We can make $f$ return some fixed element of $U$, e.g., 0, when one or both arguments of $f$ are numbers rather than vertices.
Recall that not every structure with one binary predicate defines a graph: we need the axioms saying that the relation is irreflexive and symmetric. Similarly, we need axioms for multigraphs. It is convenient to introduce two unary predicate symbols $V$ and $N$ that are true only on vertices and numbers, respectively. Then we can make an axioms saying that $f$ returns a number for any two vertices and that the order of vertices does not matter.
For the second flavor of multigraphs, we can again have (a disjoint union of) two sets: vertices and edges and two functions that return the two ends of a given edge.