This paper considers a two-way relay network in which two source nodes exchange messages during two time slots with the help of a half-duplex amplify-and-forward relay node. Closed form expressions of source and relay node powers are obtained by solving an optimization problem which aims to minimize system total power by constraining source nodes' received signal-to-noise ratios (SNR), thus satisfying the minimum quality of service (QoS). Furthermore, the variation of optimum powers versus the parameter which gives information about the channel qualities is investigated for symmetric and asymmetric QoS at the source nodes. In addition, assuming equal channel and noise variances, the effect of variance on the proposed and equal power allocation is illustrated. Numerical results show that the optimum power allocation outperforms the equal power allocation scheme in terms of total power for various variance values and QoS demands.