One can get modular curves by the following procedures: first take the uper half plane and the rationan numbers on the xaxis, then we consider the quotient by a congruence subgroup. Now we get a compact Reimann surface, and by Chow's results, it is algebraican algebraic variety. Here we start with an analytic object and finally we get an algebraic one. But can we use algebraic methords only (e.g. by quotients of group schemes) to get modular curves? Or, can we find a meanful moduli problem solved by a modular curve?

Modular curves are moduli spaces of elliptic curves with additional (torsion) structure and can be constructed purely algebraically. If you start with an elliptic curve $E$ with transcendental $j$invariant $j$, over an arbitrary algebraically closed field $k$, and adjoin to $k(j)$ the $x$coordinates of the $N$torsion points of $E$ you get a function field over $k$ which is the function field of $X(N)$. See Rohrlich's paper in the CornellSilvermanStevens volume on Fermat's Last Theorem or KatzMazur. Edit: Note, however, Brian's warning in the comments. 


It is not possible to get the modular curves via a quotient construction purely in the category of schemes. On the one hand one needs to start with the upper halfplane, which is simply not an algebraic object, and on the other hand one needs to take the quotient by an infinite discrete group, which is not an algebraic kind of quotient. On the other hand, resoundingly yes, the modular curves corresponding to congruence subgroups of $\operatorname{PSL}_2(\mathbb{Z})$ are the (at least) coarse moduli schemes attached to natural moduli problems involving moduli of elliptic curves with level $N$structure. For a very brief introduction, see p. 12 of http://math.uga.edu/~pete/modularandshimura.pdf For a serious study of these moduli problems, see e.g. Arithmetic Moduli of Elliptic Curves by Katz and Mazur. Addendum: In the notes linked to above, I briefly describe 4 different methods of constructing the canonical model of a modular curve $X(\Gamma)$ over an appropriate number field (for instance, if $\Gamma(N) \subset \Gamma$, then the "appropriate field" is contained in $\mathbb{Q}(\zeta_N)$). Briefly: #1) rationality at the cusps; #2) modular polynomials; #3) generic elliptic curves as in Rohrlich's paper referred to in Felipe's answer; #4) moduli problem. All but the first are independent of the description of $X(\Gamma)$ as a uniformized Riemann surface. 


Passing comment: Mumford's GIT constructs modular curves as quotientsnot of the upper half plane, but of some parameter space of subspaces of projective space, by an algebraic group. As for the last part of your question: sure there is a moduli problem solved by a modular curve! Isomorphism classes of elliptic curves plus level structure (e.g. point of order N) is represented by a modular curve (Y_1(N) in this case, as long as N>=4). 

