This paper proposes a medium access control (MAC) protocol with network coding on relay nodes for contention-based multihop wireless relay networks. The proposed protocol is called coded packet priority access (CPPA) protocol in which coded packets have higher transmission opportunity than non-coded native packets at relay nodes. In this paper, the performance of coded packet immediate access (CPIA) protocols, which are a subclass of CPPA protocols, is evaluated for single-relay bidirectional symmetric traffic and upper and lower bounds of analytical throughput are derived for any given node traffic. It is shown that the lower bound approximates to the throughput obtained from computer simulations with high accuracy. The conventional slotted ALOHA protocol with network coding (S-ALOHA/NC) is required to adapt the transmission probability of relay node to a rational function of node traffic so as to maximize the throughput whereas the CPIA protocol achieves the maximal throughput only if the relay node transmits no native packets. Furthermore it is clarified that the CPIA protocol is superior to the S-ALOHA/NC protocol in delay for given retransmission probabilities of user nodes.