If I'm limited to only a typeface, can I still use its font variants (like various weights and italics) and have it still be considered only a typeface?
You could use as many font variants within a typeface as you'd want, but don't go overboard.
It is a great idea to limit yourself to only two typefaces for a project. 'Typeface' is the important term here, as opposed to 'font'.* You are free to use any font variants (weights, italics) within the same typeface and still retain the uniformity that the two-typeface rule was meant to create. Don't use too many different ones, though--dont be tempted to put all 16 weights of Montserrat into your branding project, unless it is a huge project and sixteen different use cases are required.
*A typeface is a collection of fonts. Helvetica is a typeface; Helvetica bold and Helvetica black italic are fonts.