1. Besides the position of ramification points $z_j$ you need monodromy of $Q$ to determine $M$. Once $M$ is defined, you need a normalization of your uniformizing function: it is defined up to a conformal automorphism of the sphere $L^1$.

2. No general formula exists. To find the uniformization in the case of genus $0$, you have to find a rational function with simple critical points and prescribed critical values. The degree of your function is $M+1$ by Riemann-Hurwitz formula. You write it with undetermined coefficients, add normalization, for example $f(0)=a,f(1)=b,f(\infty)=c$, where $a,b,c$ are some points distinct from your $z_j$, and write the condition that critical values are $z_j$. You obtain $2M+3$ algebraic equations with $2M+3$ unknowns,
this system has finitely many solutions. Different solutions correspond to different possible monodromies. The system is difficult to solve when the degree is high. 

EDIT: You may look at this paper, where a special case of the problem is studied in great detail: Rational functions with real critical points and the B. and M. Shapiro conjecture in real enumerative geometry, Ann of Math., 155 (2002), 105-129.