Labor Market Frictions and Optimal Bargaining Power