So the flexor muscle is the muscle that contracts and decreases the angle at the joint with respect to our moveable bone while the extenter is the muscle that lengthens and increases the angle at the joint. So in this particular case, our bicep is acting as our flexor because it is decreasing that angle with respect to the joint and our arm that is moving. In this case, the bicep is acting as the extensor because as we are extending our arm the angle basically increases. And that's exactly why our bicep is an extensor in this case. So we see any given muscle can act as an agonist but it can also act as an antagonist. By the same token, it can act as an extensor but it can also act as a flexor in other cases.