Bayern agrees Lewandowski move to Barcelona