Influence Guided Context Selection for Effective Retrieval-Augmented Generation