In contracts and agreements, I have seen clause, article, and section used for what seems to be the same thing, namely the (often numbered) sections into which the contract/agreement is divided. Now I'm wondering if these are just synonyms (as they seem to be), or if there is, in fact, a difference between them from a law point of view.
While "clause" has a specific definition in linguistics, that is not how it is used in laws and legal documents. These terms have no standard definition for legal writing. Documents or legal codes that use both generally use "article" to mean a larger division than "clause" does. In discussion of the US Federal Constitution, for example, the largest divisions are called "articles", each of which is divided into several "sections", and each section generally contains several "clauses". Some of these are actually grammatical clauses, being part of a sentence with a verb and a subject, while others might be called paragraphs in ordinary prose.
A given document or legal code should ideally define which terms it will use for its parts, and which contain which others. This can be done in whatever way the drafters wish, but it is desirable that it be clear.
In addition to the terms you have mentioned, terms often used include "subsection", "subsubsection", "title", "paragraph", "subparagraph", "chapter", "part" and "division". These are not used consistently, and I have never seen a single document or code that uses all of them. The Us law code is divided into titles, each of which contains sections. In some of these sets of related sections are grouped into chapters. Sections may have subsections or paragraphs.
In my experience smaller contracts or business documents rarely use "articles" and some just use "section" for any named or numbered part of the document.
Usually titles or section headers are explicitly stated to have no legal effect, and the division into sections or other parts is simply to facilitate reference, and does not have legal significance. Whether a provision is called an article, a section, or a clause will not normally change its legal effect. However, where one part of a document refers to another part, such as "as specified in section 23" then the reference will be found in and only in the designated part, and will not be looked for in some other part.