Distributing under the GPL is a software license agreement which is absolutely a contract:

A software license agreement is a legal contract that grants you permission to use software without transferring ownership. The software creator retains intellectual property rights while giving you specific usage rights under defined terms and conditions.

- https://ironcladapp.com/journal/contracts/software-license-agreement