The question is not answerable using only the equations and constraints given. However, we can get close to the answer.
Power out of the motor
Mechanical power is calculated by:
$$P = Fv = mgv$$
Where $m$ is the mass, $g$ is the gravitational constant and $v$ is the speed at which the mass is being lifted.
Assuming that the string wraps around some kind of barrel with a radius $r_b$ attached to a gear with radius $r_2$, then the torque $T_2$ applied to the gear by the load is:
$$T_2 = mgr_2$$
and the speed $\omega_2$ at which the gear rotates is
$$\omega_2 = \frac{v}{r_2}$$
Let the radius of the gear attached to the motor be $r_1$ and let the gear ratio be defined as:
$$G = \frac{r_1}{r_2}$$
Then the torque applied on the motor is $T = GT_2$ and the speed of the motor is $\omega = \omega_2/G$. You can see that the power out of the motor (i.e. the power to lift the load) is independent of G.
$$P_{out} = T\omega = GT_2\frac{1}{G}\omega_2 = T_2\omega_2$$
Power into the motor
Assuming a DC motor, it will be powered by a power supply which outputs a voltage $V$ and a current $i$. The power consumed by the motor is then whatever is being supplied by the power source:
$$P_{in} = Vi$$
In the question you gave the following equations:
$$V = iR + K\omega$$
$$T = (i-i_o)K$$
If we rearrange the second equation for $i$ and then insert both equations into the power equation we get (after a lot of algebra):
$$P_{in} = \frac{(T+Ki_o)^2}{K^2}\left(R+\frac{K^2\omega}{T+Ki_o}\right)$$
Now we can substitute the expressions for $T_2$ and $w_2$ to get the gear ratio into the equation:
$$P_{in} = \frac{(GT_2+Ki_o)^2}{K^2}\left(R+\frac{K^2\omega_2}{G(GT_2+Ki_o)}\right)$$
With a little rearranging again we get:
$$P_{in} = \frac{(GT_2+Ki_o)^2}{K^2(G^2T_2+GKi_o)}\left(R+K^2\omega_2\right)$$
Now this can be simplified a lot by grouping all of the constant terms so that we can see what effect G has on the power required.
$$P_{in} = a_1\frac{(G+a_2)^2}{G(G+a_3)}(G(G+a_4)+a_5)$$
Great algebra, but what does it all mean?
If you take the limits as $G$ approaches infinity and $G$ approaches zero you will notice that in both cases the $P_{in}$ goes to infinity. This means that there is likely some optimal value or several optimal values of $G$ between zero and infinity that minimize the consumed power for a given output power. Those values will depend on the values of every other variable in the equation (how fast are you raising the load, what is the mass of the load, what are the values of $R$ and $K$, etc.?).