We consider the problem of optimal channel access to provide quality of service (QoS) for data transmission in cognitive vehicular networks. In such a network, the vehicular nodes can opportunistically access the radio channels (referred to as shared-use channels) which are allocated to licensed users. Also, they are able to reserve a channel for dedicated access (referred to as exclusive-use channel) for data transmission. A channel access management framework is developed for cluster-based communication among vehicular nodes. This framework has three components: opportunistic access to shared-use channels, reservation of exclusive-use channel, and cluster size control. A hierarchical optimization model is then developed for this framework to obtain the optimal policy. The objective of the optimization model is to maximize the utility of the vehicular nodes in a cluster and to minimize the cost of reserving exclusive-use channel while the QoS requirements of data transmission (for vehicle-to-vehicle and vehicle-to-roadside communications) are met, and also the constraint on probability of collision with licensed users is satisfied. This hierarchical optimization model comprises of two constrained Markov decision process (CMDP) formulations - one for opportunistic channel access, and the other for joint exclusive-use channel reservation and cluster size control. An algorithm is presented to solve this hierarchical optimization model. Performance evaluation results show the effectiveness of the optimal channel access management policy. The proposed optimal channel access management framework will be useful to support mobile computing and intelligent transportation system (ITS) applications in vehicular networks.