Andrew Bynum agrees to two-year contract with Cavaliers