In this paper, we propose a two-way cooperative relay scheme based on non-orthogonal multiple access (NOMA) where bidirectional communication is supported for two users in three phases. We jointly optimize power and time allocations to minimize system outage probability whose exact closed-form expression is derived and verified by Monte Carlo simulations. For performance comparison, four schemes based on power allocation and time allocation as well as the conventional one-way cooperative NOMA (OW-CNOMA) scheme are provided. It is shown that the proposed scheme can improve outage probability and ergodic rate performances over a conventional OW-CNOMA system.