Self-consistent effect of ohmic losses on output power of gyrotron