I'm trying to define the concept of universal object in category theory, but I failed to find a universal way to do it. Maybe someone can help ?
THe idea is quite simple. Let $\mathcal{C}$ be a category, and call $U$ universal if for all objects $A$ in $\mathcal{C}$, there exists a monic map from $A$ to $U$. That is, all objects inject inside $U$. I don't know if this definition is the good one, but that's the idea.
Example: $\mathbb{N}$ is the universal object of countable set. $(\mathbb{Q}, \leq)$ is the universal object of countable totally ordered sets, and so on.
Something to be aware of: using "universal object" to mean "an object into which every other object embeds" is not uncommon in areas outside of category theory (one hears of universal graphs, universal metric spaces, universal Polish spaces, ...), but note that within category theory, "universal object" strongly connotes that the "universality" property should characterize the object up to canonical isomorphism, a connotation which doesn't apply in the "embedding sense".
The adequacy of your definition will depend on what sort of examples you're trying to capture. Let me guess that the Rado graph (as a universal countable graph), the Urysohn universal space (as a universal separable metric space), and Hilbert Cube (as a universal Polish space) are some examples you want to include. Notice that requiring $A \to U$ to be monic is not enough in these examples: for instance, a monomorphism of graphs is a subgraph, but the fact that the Rado graph contains every countable graph as a subgraph is not as interesting as the fact that it contains every countable graph as an induced subgraph.
So you want to require that there is an "embedding" $A \to U$ for every object $A$. But it's not clear that there's a single categorical meaning of "embedding" that will be the interesting one in every case: it may depend on the category. Some discussion of the notion of "embedding" in category theory can be found in the wikipedia article, and The Joy of Cats to which it refers should have more information.
ADDENDUM: I wrote the above about two years ago, and I only just learned something more about this subject, largely from Trevor Irwin's thesis, which gives a categorical treatment of Fraïssé limits, a construction which can be used to construct the random graph, for example.
Let $\mathcal{C}$ be a category and let $\mathcal{F} \subseteq \mathcal{C}$ be a full subcategory.
We say that $X \in \mathcal{C}$ is $\mathcal{F}$-universal if every $F \in \mathcal{F}$ admits a morphism $F \to X$.
We say that $X \in \mathcal{C}$ is $\mathcal{F}$-injective if for every $F' \leftarrow F \to X$ with $F,F' \in \mathcal{F}$ there exists $F' \to X$ making a commutative triangle.
We say that $X \in \mathcal{C}$ is $\mathcal{F}$-homogeneous if for every $X \leftarrow F \to X$ with $F \in \mathcal{F}$, there is an automorphism $X \cong X$ making a commutative triangle.
Now suppose that
$\mathcal{C}$ has colimits of ($\mathbb{N}$-indexed) chains $C_0 \to C_1\to \dots$ (equivalently, $\mathcal{C}$ has countable filtered colimits).
$\mathcal{F}$ has the property that if $f: F \to \varinjlim C_i$ is a morphism in $\mathcal{C}$ from an object $F \in \mathcal{F}$ to a colimit $\varinjlim C_i$ of a chain $C_0 \to C_1 \to \dots$ in $\mathcal{C}$, then $f$ factors through some $C_i$ (this follows if every $F \in \mathcal{F}$ is finitely presentable).
Proposition. If (1) and (2) hold and $X \in \mathcal{C}$ is a colimit of a chain of objects of $\mathcal{F}$, then the following are equivalent and characterize $X$ up to isomorphism:
(i.) $X$ is $\omega\mathcal{F}$-universal and $\mathcal{F}$-homogeneous
(ii.) $X$ is $\mathcal{F}$-universal and $\mathcal{F}$-homogeneous
(iii.) $X$ is $\mathcal{F}$-universal and $\mathcal{F}$-injective.
Here $\omega \mathcal{F}$ denotes the closure of $\mathcal{F}$ under colimits of chains.
Proof. (i.) -> (ii.) is trivial. (ii.) -> (iii.) requires just a moment's thought. (iii.) -> (ii.) uses a back-and-forth argument, inductively building up both directions of an isomorphism, working up the chain defining $X$. (iii.) -> (i.) is easy. The fact that (iii.) characterizes $X$ up to isomorphism use another back-and-forth argument.
Let's call an $X$ satisfying the equivalent condtions of the proposition $\mathcal{F}$-saturated. We can get existence of such an $X$ with some mild additional conditions on $\mathcal{F}$:
$\mathcal{F}$ has the joint embedding property: any pair of objects $F_1, F_2 \in \mathcal{F}$, admit a cocone, i.e. there is a diagram $F_1 \to F_3 \leftarrow F_2$ in $\mathcal{F}$.
$\mathcal{F}$ has the amalgamation property: any span $F_1 \leftarrow F_0 \to F_2$ in $\mathcal{F}$ admits a cocone, i.e. it can be completed to a commutative square like
$\require{AMScd} \begin{CD} F_0 @>>> F_1\\ @VVV @VVV \\ F_2 @>>> F_3 \end{CD} $
Theorem. If (1,2,3,4) hold and $\mathcal{F}$ is essentially countable then there exists an $\mathcal{F}$-saturated object $X \in \mathcal{C}$ which is a colimit of a chain of objects of $\mathcal{F}$. Conversely, if there exists an $X \in \mathcal{C}$ which is $\mathcal{F}$-injective and $\mathcal{F}$-universal, and which is a colimit of a chain of objects of $\mathcal{C}$ and (2) holds, then (3,4) hold.
Proof. We construct a chain $X_0 \to X_1 \to \dots$ whose colimit is will be $X$. The idea is to solve the lifting problems of $\mathcal{F}$-universality and $\mathcal{F}$-injectivity by using (3) and (4) to extend the chain with solutions to these lifting problems. Then since any lifting problem must factor through a finite stage of the chain, it can be solved at a finite stage and thus be solved in the colimit. Some care must be taken in doing this, see Irwin's thesis or another reference on the Fraïssé construction. The "conversely" statement takes just a moment's reflection.
When we take $\mathcal{C}$ to be the category of graphs and embeddings and $\mathcal{F}$ to be the subcategory of finite graphs, we construct the Rado graph this way, and similarly other Fraïssé limits. When we take $\mathcal{C}$ to be the category of complete metric spaces and isometric embeddings and $\mathcal{F}$ to be the subcategory of finite metric spaces with rational distances, we construct the Urysohn universal space this way.
Everything generalizes easily to cardinalities $\kappa$ larger than countable -- in (1) $\mathcal{C}$ will have to be closed under colimits of chains of length $\leq \kappa$, while in (2), $\mathcal{F}$ will have to have this property with respect to chains of length $\kappa$ and moreover be closed under colimits of chains of length less than $\kappa$. (3) and (4) require no modification. In the existence theorem we require that $\mathcal{F}$ have size essentially $\leq \kappa$. By taking $\mathcal{C}$ to be the category of models of a first-order theory and $\mathcal{F}$ to be the models of size $< \kappa$, we recover the construction of saturated models in the usual sense in model theory, with the usual set-theoretical provisos.
I haven't checked whether this theorem applies to give a construction of the Hilbert cube.
The construction will be somewhat degenerate in a category where morphisms are not monic -- think about what $\mathcal{F}$-injectivity means in this case. So $\mathcal{C}$ and $\mathcal{F}$ might be non-full subcategories of a category that you're primarily interested in.