Theory of ac losses in type‐II superconductors with a field‐dependent surface barrier