In this paper, we propose a multiuser cognitive relay network, where multiple secondary sources communicate with a secondary destination through the assistance of a secondary relay in the presence of secondary direct links and multiple primary receivers. We consider the two relaying protocols of amplify-and-forward (AF) and decode-and-forward (DF), and take into account the availability of direct links from the secondary sources to the secondary destination. With this in mind, we propose an optimal solution for cognitive multiuser scheduling by selecting the optimal secondary source, which maximizes the received signal-to-noise ratio (SNR) at the secondary destination using maximal ratio combining. This is done by taking into account both the direct link and the relay link in the multiuser selection criterion. For both AF and DF relaying protocols, we first derive closed-form expressions for the outage probability and then provide the asymptotic outage probability, which determines the diversity behavior of the multiuser cognitive relay network. Finally, this paper is corroborated by representative numerical examples.