the numbers will be correct if you vacuum first since relplages is updated when vacuuming.
here is an example:
# select relpages , relname, relfilenode from pg_class where relfilenode = 1005440;
relpages | relname | relfilenode
----------+-------------------+-------------
34 | apm_package_files | 1005440
34 * 8 * 1024 = 278528
$ wc -c ./base/1004872/1005440
327680 ./base/1004872/1005440
# vacuum analyze apm_package_files;
VACUUM
xarg=# select relpages , relname, relfilenode from pg_class where relfilenode = 1005440;
relpages | relname | relfilenode
----------+-------------------+-------------
40 | apm_package_files | 1005440
40*8*1024 = 327680.