The total output of the coinbase transaction of a block is normally the sum of the current block reward (which is newly created bitcoins) and the transaction fees from all the transactions in the block (which are not newly created coins, but are effectively being transferred from the users who made the transactions).
To put it another way, the following constraint is enforced for each block:
Total of tx outputs <= total of tx inputs + block reward
(normally it will be exactly equal, unless the miner has screwed up)
as well as the following constraint for each non-coinbase transaction:
Sum of outputs <= sum of inputs
You can see that the first constraint ensures that the number of "newly created" coins is no larger than the block reward (normally equal). Then, a non-coinbase transaction can grant a transaction fee by having the sum of its outputs strictly less than the sum of its inputs. The miner can then take the difference and add it to the coinbase transaction without violating constraint 1, thus collecting the transaction fee.