Value-Incentivized Preference Optimization: A Unified Approach to Online and Offline RLHF