Expertise and confidence explain how social influence evolves along intellective tasks