Energy-Efficient Context-Aware Resource Allocation in D2D Communications: An Iterative Matching Approach